package cn.getech.data.development.function

import java.lang

import cn.getech.data.development.sink.jdbc.config.CustomTableConfig
import org.apache.flink.api.common.functions.MapFunction
import org.apache.flink.api.java.tuple
import org.apache.flink.types.Row

@deprecated
class HDFSTextMapFunction(conf: CustomTableConfig) extends MapFunction[tuple.Tuple2[lang.Boolean, Row], String] {
  override def map(t: tuple.Tuple2[lang.Boolean, Row]): String = {
    val sb = new StringBuilder
    for (i <- 0 until conf.getParamSize) {
      sb.append(t.f1.getField(i)).append(conf.delimitFormat)
    }
    sb.delete(sb.length() - 1, sb.length())
    sb.toString()
  }
}
